package evobot {
	import mx.controls.TextArea;
	
	public class Log {
		static private var _instance:Log = new Log();
		private var log:TextArea = null;
		
		public function Log()
		{
			if (_instance != null){ 
                throw new Error("Log can only be accessed through Log.getInstance()");
            }
		}
		
		static public function getInstance():Log {
			return _instance;
		}
		
		public function registerLog(log:TextArea):void {
			this.log = log;
		}
		
		public function write(text:String):void {
			if (log != null) {
				log.text += text + "\n";
			}
		}

	}
}